//============================================================================================
/**
 * @file	scr_deposit_win.c
 * @brief	スクリプトコマンド：貯金ウィンドウ関連
 * @author	Hiroyuki Nakamura
 * @date	09.03.13
 */
//============================================================================================
#include "common.h"

#include "system/wordset.h"

#include "script.h"
#include "scrcmd_def.h"
#include "ev_win.h"

#include "scr_deposit_win.h"


//--------------------------------------------------------------------------------------------
/**
 * 貯金ウィンドウ表示
 *
 * @param	core		仮想マシン制御構造体へのポインタ
 *
 * @return	"0"
 */
//--------------------------------------------------------------------------------------------
BOOL EvCmdDepositWinWrite( VM_MACHINE * core )
{
	FIELDSYS_WORK * fsys = core->fsys;
	u16 x = VMGetWorkValue( core );
	u16 y = VMGetWorkValue( core );
	GF_BGL_BMPWIN** win = GetEvScriptWorkMemberAdrs( fsys, ID_EVSCR_GOLDWINDAT );

	*win = EvWin_DepositWinPut( core->fsys, x, y );
	return 0;
}

//--------------------------------------------------------------------------------------------
/**
 * 所持金ウィンドウ削除
 *
 * @param	core		仮想マシン制御構造体へのポインタ
 *
 * @return	"0"
 */
//--------------------------------------------------------------------------------------------
BOOL EvCmdDepositWinDel( VM_MACHINE * core )
{
	FIELDSYS_WORK* fsys = core->fsys;
	GF_BGL_BMPWIN** win = GetEvScriptWorkMemberAdrs( fsys, ID_EVSCR_GOLDWINDAT );
	EvWin_DepositWinDel( *win );
	return 0;
}

//--------------------------------------------------------------------------------------------
/**
 * 所持金ウィンドウ再表示
 *
 * @param	core		仮想マシン制御構造体へのポインタ
 *
 * @return	"0"
 */
//--------------------------------------------------------------------------------------------
BOOL EvCmdDepositWrite( VM_MACHINE * core )
{
	FIELDSYS_WORK* fsys = core->fsys;
	GF_BGL_BMPWIN** win = GetEvScriptWorkMemberAdrs( fsys, ID_EVSCR_GOLDWINDAT );
	EvWin_DepositWrite( core->fsys, *win );
	return 0;
}


